<?php
define('CANSHU_ERROR',1);
define('LOGIN_SUCCESS',2);
define('LOGIN_ERROR',3);
define('GET_DATA_SUCCESS',4);
define('GET_DATA_FAILE',5);
define('INTEGRAL_LESS',6);
define('PUSH_SUCCESS',7);
define('PUSH_FAIL',8);
define('CANNOT_SEE_SELF',9);
define('TASK_NOT_EXIST',10);
define('CANCEL_SUCCESS',11);
define('CANCEL_FAIL',12);
define('CHOSE_FUCE_LIKE_IMG',13);
define('CHOSE_COMMENT_IMG',14);
define('SUBMIT_SUCCESS',15);
define('REASON_CONNOT_EMPTY',16);
define('UPDATE_SUCCESS',17);
define('UPDATE_FAIL',18);
define('UPLOAD_SUCCESS',19);
define('UPLOAD_FAIL',20);
define('TASK_IS_UNDO',21);
$msgArr=array(
    CANSHU_ERROR     => '参数错误！',
    LOGIN_SUCCESS    => '登录成功',
    LOGIN_ERROR    => '登录失败',
    GET_DATA_SUCCESS    => '获取数据成功',
    GET_DATA_FAILE    => '获取数据失败',
    INTEGRAL_LESS     => '积分不足',
    PUSH_SUCCESS      =>'发布成功',
    PUSH_FAIL         => '发布失败',
    CANNOT_SEE_SELF   => '不能浏览自己的任务',
    TASK_NOT_EXIST    => '任务不存在',
    CANCEL_SUCCESS    => '撤销成功',
    CANCEL_FAIL       => '撤销失败',
    CHOSE_FUCE_LIKE_IMG       => '请上传点赞关注截图',
    CHOSE_COMMENT_IMG       => '请上传评论截图',
    SUBMIT_SUCCESS       => '提交成功',
    REASON_CONNOT_EMPTY  => '拒绝原因不能为空',
    UPDATE_SUCCESS       => '修改成功',
    UPDATE_FAIL       => '修改失败',
    UPLOAD_SUCCESS   => '上传成功',
    UPLOAD_FAIL      => '上传失败',
    TASK_IS_UNDO      => '任务已被撤销',
);
define('MESSAGE_ARRAY',$msgArr);
function checkMsg($msg){
    $code=$msg;
    $message=MESSAGE_ARRAY[$msg];
    $msg=['code'=>$code,'msg'=>$message];
    return $msg;
}